home *** CD-ROM | disk | FTP | other *** search
- Sample Console-Basic Programs
-
- This file contains some sample programs for use with the Console app. Copy
- the contents of "ProgramCode" into the Main() method of the ProgramCode class
- in RB. Copy the contents of "ProgramData" (if any) into the Text property of
- the big text box in the ProgramData class in RB. Then Run and enjoy!
-
-
- ======================================================================
- ProgramCode:
-
- // This program asks your name, then prints it a number of times.
- Dim i as Integer
- Dim qtystr as String
- Dim name as String
- Dim s as String
- Dim done as Boolean
-
- do until done
- Clear
- Input "Enter your name: ", name
- Input "Enter quantity: ", qtystr
-
- for i = 1 to Val(qtystr)
- Print name + " was here!"
- next
-
- Input "Do it again (Y/N)? ", s
- done = (left(s,1) = "N")
- loop
- ----------------------------------------------------------------------
- ProgramData:
- (none)
- ----------------------------------------------------------------------
-
-
-
-
- ======================================================================
- ProgramCode:
-
- // Demonstrates use of the Read statement to grab
- // data from ProgramData.
- Dim i as integer
- Dim s as String
- Dim d as Double
-
- for i = 1 to 3
- ReadStr s
- Print "String... >" + s + "<"
- next
-
- for i = 1 to 3
- ReadNum d
- PrintNoCR "Number... "
- Print d
- next
- ----------------------------------------------------------------------
- ProgramData:
- "foo","bar"
- "baz", 1
- 2.5,3.8
- ======================================================================
-